/**
 * Project: lionbule-other
 * 
 * File Created at 2012-3-27
 * $Id$
 * 
 * Copyright 1999-2100 Alibaba.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package com.sun;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

/**
 * TestHashMap.
 * @author LionBule
 *  2012-3-27 下午5:00:52
 */
public class TestHashMap {

    /**
     * @param args
     */
    public static void main(String[] args) {
        Map<String,String> t = new HashMap<String, String>();
        t.put("t1", "t1");
        t.put("t2", "t2");
        t.put("t3", "t3");
        
        Set<Entry<String, String>> n = t.entrySet();
        while(n.iterator().hasNext()){
            Entry<String, String> tn = n.iterator().next();
            System.out.println(tn.getKey());
        }
        
        
//        for(Entry<String, String> m:t.entrySet()){
//            System.out.println(m.getKey());
//            if(m.getKey().equals("t2")){
//                t.remove(m.getKey());
//                t.put("t4", "t4");
//            }
//        }
        
    }

}
